package org.eclipse.baseball;

import static org.junit.Assert.*;

import java.io.FileNotFoundException;

import org.eclipse.football.League;
import org.eclipse.football.Team;
import org.junit.Test;

public class duplicateTeam {

	@Test
	public void test() throws FileNotFoundException {
		// Create a league
		League league = new League();
		
		// Create two teams with the same name
		Team team1 = new Team("name");
		Team team2 = new Team("name");
		
		// Add the first team to the league
		league.addTeam(team1);
		
		// Get the size of the the league
		int old_size = league.getTeams().size();
		
		// Try to add the second team to the league
		league.addTeam(team2);
		
		// Check if the size of the league is the same
		if(old_size != league.getTeams().size()){
			// If not then fail
			fail("Added team with a duplicate name to a league.");
		}
	}

}
